<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2016/11/9
 * Time: 13:46
 * 支付成功頁面
 */

require_once('env.php');
require('init.inc.php');
include_once 'functions.php';


$index_obj = ShopConfig::getConfig();
$order_item = getKdInfoBySn($_GET['order_sn']);
if ($order_item["isGo"] == 0) {
    $kd['is_fh'] = "未發貨";
    $kd['kd_status'] = "";
} elseif ($order_item["isGo"] == 1) {
    $kd['is_fh'] = "已發貨";
    $kd['kd_status'] = getheimaoStatusByAPI($order_item["kd_sn"]);
} else {
    $kd['is_fh'] = "取消訂單";
    $kd['kd_status'] = "";
}

$tongji1 = home_tongji(1);
$tongji2 = home_tongji(2);
$tongji3 = home_tongji(3);
?>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title><?php echo $index_obj['title'] ?></title>
    <meta name="Keywords" content="<?php echo $index_obj['kewords']; ?>"/>
    <meta name="Description"
          content="<?php echo $index_obj['description']; ?>"/>
    <link href="style/css/reset.css" rel="stylesheet" type="text/css"/>
    <script src="style/js/jquery.min.js"></script>
</head>
<body>
<div class="container" style="text-align: center; border: 1px solid #E1E1E1; margin: 30px; height: 300px;">
    <div class="top" style="padding: 20px; border-bottom: 1px dashed #E1E1E1; margin: 0 30px;">
        <img src="style/img/yes.png" alt="">
        <h4 style="font-size: 30px;">成功</h4>

        <table class="table">
            <tr>
                <th class="center success" colspan="2">物流詳情</th>
            </tr>
            <tr>
                <th width="120">是否發貨</th>
                <td style="color: red;font-size: 20px;">
                    <?php echo $kd['is_fh'] ?>
                    <small></small>
                </td>
            </tr>
            <tr>
                <th>快遞公司</th>
                <td><?php echo $order_item['kd_name'] ?></td>
            </tr>
            <tr>
                <th>快遞官網</th>
                <td><?php echo $order_item['kd_url'] ?></td>
            </tr>
            <tr>
                <th>快遞單號</th>
                <td><?php echo $order_item['kd_sn'] ?></td>
            </tr>
            <tr>
                <th>快遞狀態</th>
                <td><?php echo $kd['kd_status'] ?></td>
            </tr>
        </table>
        <h4 class="center">貨物到達時間為5-7個工作日,有問題請諮詢客服</h4>
    </div>
    <p style="margin-top: 50px; padding: 0 30px; font-size: 10px;"><a
            href="<?php echo SERVER_ROOT ?>" style="color: blue">繼續購物</a>
    </p>
</div>
<div style="display: none;">
    <?php echo str_replace('&nbsp;', '', htmlspecialchars_decode($tongji1['tongji'], ENT_QUOTES)) . '<br/>' . str_replace('&nbsp;', '', htmlspecialchars_decode($tongji2['tongji'], ENT_QUOTES)) . '<br/>' . str_replace('&nbsp;', '', htmlspecialchars_decode($tongji3['tongji'], ENT_QUOTES)) . '<br/>'; ?>
</div>

</body>
</html>

